{% extends "base.html" %}
{% block content %}
<div id="upload">
	<form action="{{ action }}" method="post" enctype="multipart/formdata">
		<input type="file" name="file"/>
		<input type="submit"/>
	</form>
	{% if files %}
		<table id="lastfiles">
			<caption>Last uploaded files</caption>
			<tbody>
				<thead>
					<tr>
						<th>ID</th>
						<th>Name</th>
						<th>Type</th>
						<th>Date</th>
					</tr>
				</thead>
				{% for file in files %}
					<tr>
						<td>{{ file.id }}</td>
						<td><a href="/file/serve?key={{ file.key|uurlencode }}">{{ file.filename }}</a></td>
						<td>{{ file.content_type }}</td>
						<td>{{ file.creation|date:"d.m.y" }}</td>
					</tr>
				{% endfor %}
			</tbody>
		</table>
	{% endif %}
</div>
{% endblock %}
